package com.feng.study.model;

import com.fasterxml.jackson.annotation.JsonFilter;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)//开启链式get、set
//@JsonFilter("cart_filter")
public class Cart implements Comparable<Cart>{

    private String cartId;

    private Integer allNumber;

    private String totalPrice;

    private List<Product> productList;

    @Override
    public int compareTo(Cart o) {
        if (this.allNumber>=o.getAllNumber()){
            return 1;
        }else {
            return -1;
        }
    }
}
